import request from '@/utils/request'

// 查询工序外协报工记录列表
export function listOutsourcefeedback(query) {
  return request({
    url: '/pro/outsourcefeedback/list',
    method: 'get',
    params: query
  })
}
export function selectOrderForFeedback(query) {
  return request({
    url: '/pro/outsourcefeedback/selectOrderForFeedback',
    method: 'get',
    params: query
  })
}

// 查询工序外协报工记录详细
export function getOutsourcefeedback(recordId) {
  return request({
    url: '/pro/outsourcefeedback/' + recordId,
    method: 'get'
  })
}

export function getOutsourcefeedbackInfo(recordId) {
  return request({
    url: '/pro/outsourcefeedback/info/' + recordId,
    method: 'get'
  })
}
// 新增工序外协报工记录
export function addOutsourcefeedback(data) {
  return request({
    url: '/pro/outsourcefeedback',
    method: 'post',
    data: data
  })
}

// 修改工序外协报工记录
export function updateOutsourcefeedback(data) {
  return request({
    url: '/pro/outsourcefeedback',
    method: 'put',
    data: data
  })
}

export function submitOutsourcefeedback(data) {
  return request({
    url: '/pro/outsourcefeedback/submit',
    method: 'put',
    data: data
  })
}
export function approve(recordId,status) {
  return request({
    url: '/pro/outsourcefeedback/approve',
    method: 'put',
    data: {recordId:recordId,status:status}
  })
}

// 删除工序外协报工记录
export function delOutsourcefeedback(recordId) {
  return request({
    url: '/pro/outsourcefeedback/' + recordId,
    method: 'delete'
  })
}
export function getOutsourcefeedbackDrawing(lineId) {
  return request({
    url: '/pro/outsourcefeedback/selectDrawing/' + lineId,
    method: 'get'
  })
}
